package com.pattern.practice.observer;

import java.util.Scanner;

public class Application {
    public static void main(String[] args) {
        HealthData healthData = new HealthData();
        new Panel1(healthData);
        new Panel2(healthData);
        healthData.setHealthData(12, 23);
        healthData.setHealthData(15, 65);
        int count = 0;
        Scanner scanner = new Scanner(System.in);
        while (count <= 2) {
            if (scanner.hasNext()) {
                String[] split = scanner.next().split(",");
                healthData.setHealthData(Integer.parseInt(split[0]), Integer.parseInt(split[1]));
            }
            count++;
        }
    }
}
